<?php
namespace app\api\validate;

use think\Validate;

class WeekCourse extends Validate
{
    protected $rule =   [
        'title' => 'require|max:30',
        'stage_id' => 'require|number|notin:0',
        'status' => 'require|in:0,1'
    ];
    
    protected $message  =   [
        'title.require' => '课程内容不能为空',
        'title.max' => '内容长度不能超过30个字符',
        
        'stage_id.require' => '缺失必要参数',
        'stage_id.number' => '阶段id参数错误',
        'stage_id.notin' => '阶段id参数错误',

      
        'status.in' => '修改参数错误',
        'status.require' => '修改参数不能为空',
    ];

    protected $scene = [
        // 添加周期
        'createWeekCourse' => ['title','stage_id'],
        //修改周期状态
        'editWeekCourse' => ['status'],
        //编辑周期内容
        'updateWeekCourse' => ['title'],
    ];
    
}